package com.example.service_statistics.schedule;

import com.example.common.commonsutils.DateFormatUtils;
import com.example.service_statistics.service.StatisticsDailyService;
import jakarta.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author:tjf
 * @Description:
 */
@Component
public class StatisticsTask {
    @Resource
    private StatisticsDailyService statisticsService;
    @Scheduled(cron = "* * 1 * * ?")
    public void handleStatisticsTask(){
        String dateStr = DateFormatUtils.getDateStr();
        statisticsService.saveStatisticsData(dateStr);
    }
}
